using System;
using System.Collections.Generic;

namespace HareGame
{
    public partial class TaskData
    {
        /// <summary>
        /// 当前数量
        /// </summary>
        public int CurCount
        {
            get
            {
                int count = 0;
                switch (Type)
                {

                }
                return count;
            }
        }

        /// <summary>
        /// 是否可以完成
        /// </summary>
        public bool IsReady2Complete => CurCount >= NeedCount;

        /// <summary>
        /// 是否已经完成
        /// </summary>
        public bool IsCompleted
        {
            get
            {
                return GameEntry.GameData.GetBool(UserData.TaskID + ID);
            }
            set
            {
                GameEntry.GameData.SetBool(UserData.TaskID + ID, value);
            }
        }

        /// <summary>
        /// 完成任务
        /// </summary>
        public void OnTaskComplete()
        {
            IsCompleted = true;
            GameEntry.Event.Send(EventID.RefreshTaskUI);
        }
    }
}
